package com.gdth.bank.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.gdth.bank.BankApplication;
import com.gdth.bank.R;
import com.gdth.core.annotation.view.ViewInject;
import com.gdth.core.widget.BaseActivity;
import com.gdth.database.bean.TAppYh;
import com.gdth.bank.widget.BankTextViews;

/**
 * 用户详细信息页面
 * @author arvin
 *
 */
public class UserActivity extends BaseActivity {
	@ViewInject(id=R.id.header_label_title) TextView txt_header_title;
	@ViewInject(id=R.id.header_btn_left, click="finishClick") TextView txt_header_left;
    @ViewInject(id=R.id.header_btn_right) TextView txt_header_right;
    
    @ViewInject(id=R.id.user_xm) BankTextViews txt_xm;
    @ViewInject(id=R.id.user_xb) BankTextViews txt_xb;
    @ViewInject(id=R.id.user_sfz) BankTextViews txt_sfz;
    @ViewInject(id=R.id.user_sj) BankTextViews txt_sj;
    @ViewInject(id=R.id.user_dh) BankTextViews txt_dh;

    @Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_setting_user);
		
		initView();
	}
	
	private void initView(){
		txt_header_title.setText(R.string.param19);
		txt_header_right.setVisibility(View.GONE);
		
		TAppYh user = BankApplication.mInstance.getCurrentUser();
		
		txt_xm.setLabel(user.getXm());
		txt_xm.setImage(null);
		
		txt_xb.setLabel(R.string.param20);
		txt_xb.setValue(user.getXb() == 1 ? getResources().getString(R.string.param21) : getResources().getString(R.string.param22));
		txt_xb.setImage(null);
		
		txt_sfz.setLabel(getResources().getString(R.string.param23));
		txt_sfz.setValue(user.getZh());
		txt_sfz.setImage(null);
		
		txt_sj.setLabel(getResources().getString(R.string.param24));
		txt_sj.setValue(user.getLxfs());
		txt_sj.setImage(null);
		
		txt_dh.setLabel(getResources().getString(R.string.param25));
		txt_dh.setValue(user.getLxfs());
		txt_dh.setImage(null);
	}
}
